<!DOCTYPE html>
<html>
	
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
		<title>后台权限管理系统</title>
		<link rel="stylesheet" href="css/login.css">
		<script type="text/javascript" src="lib/layui/layui.js"></script>
		<script src="js/global.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript" src="js/jquery-3.1.1.min.js"></script>
	</head>

	<body class="login-bg">
		<canvas id="fullstarbg">你的浏览器不支持canvas标签</canvas>
		<div class="login">
			<div class="message">权限管理系统登录</div>
			<div id="darkbannerwrap"></div>
			<form id="fmLogin" class="layui-form" onsubmit="return false;">
				<input type="hidden" name="token" id="loginToken" />
				<input name="name" placeholder="用户名" id="name" type="text" required lay-verify="required" class="layui-input">
				<hr class="hr15">
				<input name="password" id="password" required lay-verify="required" placeholder="密码" type="password" class="layui-input">
				<hr class="hr15">
				<button class="layui-btn" id="loginBtn" lay-submit lay-filter="login" onclick="dengLu()" style="width:100%;">登陆</button>
				<hr class="hr20">
			</form>
		</div>
	</body>
	<script>
		function dengLu(){
				$.post("../getUser",{
        			name:$("#name").val(),
        			password:$("#password").val()
        		},function(res){
        			if(res.code=="0"){
        				window.location.href = "index.html";	
        			}else{
        				alert("账号或密码错误")   
        			}     
        		},"json");
			}
	</script>

</html>